cmake_minimum_required(VERSION 2.8)
project(DWARF3D)
#include_directories("${PROJECT_SOURCE_DIR}/src")
#include_directories("C:/dev/include")
#include_directories("C:/dev/include/stlport")
#include_directories("C:/dev/include/bullet")
#link_directories("C:/dev/lib")

set(INCLUDE_SEARCH_DIRS
	"C:/dev/include/stlport"
	"C:/dev/include"
	"C:/dev/include/bullet"
	"${PROJECT_SOURCE_DIR}/src"
)

set(LIB_SEARCH_DIRS
	"C:/dev/lib"
)

include_directories(${INCLUDE_SEARCH_DIRS})
link_directories(${LIB_SEARCH_DIRS})

find_library(STLPORT stlport PATHS ${LIB_SEARCH_DIRS})
if (STLPORT)
	message("Found stlport: ${STLPORT}")
elseif (STLPORT STREQUAL "STLPORT-NOTFOUND")
	message("Could not find stlport")
endif (STLPORT)

find_library(SDL SDL PATHS ${LIB_SEARCH_DIRS})
if (SDL)
	message("Found SDL: ${SDL}")
elseif (SDL STREQUAL "SDL-NOTFOUND")
	message("Could not find SDL")
endif (SDL)

set(DWARF3D_SRC
    ./src/art/RGBA.cpp
    ./src/event/Action.cpp
    ./src/event/EventHandler.cpp
    ./src/event/KeyPressed.cpp
    ./src/event/SimpleFinalEventHandler.cpp
    ./src/Game.cpp
    ./src/GameWindow.cpp
    ./src/loader/TokenLine.cpp
    ./src/mesh/Material.cpp
    ./src/mesh/MaterialLibrary.cpp
    ./src/mesh/Mesh.cpp
    ./src/mesh/MeshLibrary.cpp
    ./src/mesh/MeshUtil.cpp
    ./src/mesh/OBJMeshLoader.cpp
    ./src/texture/Texture.cpp
    ./src/texture/TextureLibrary.cpp
    ./src/util/stringutil.cpp
    ./src/util/Timer.cpp
    ./src/world/AxisPrototype.cpp
    ./src/world/Camera.cpp
    ./src/world/Character.cpp
    ./src/world/Drawable.cpp
    ./src/world/Object.cpp
    ./src/world/ObjectMotionState.cpp
    ./src/world/RigidBody.cpp
    ./src/world/World.cpp
)

set(DWARF3D_HEADERS
    ./src/art/RGBA.h
    ./src/event/Action.h
    ./src/event/EventHandler.h
    ./src/event/KeyPressed.h
    ./src/event/SimpleFinalEventHandler.h
    ./src/exceptions.h
    ./src/export.h
    ./src/Game.h
    ./src/GameWindow.h
    ./src/loader/ResourceLibrary.h
    ./src/loader/ResourceLoader.h
    ./src/loader/TokenizedResourceLoader.h
    ./src/loader/TokenLine.h
    ./src/mesh/Material.h
    ./src/mesh/MaterialLibrary.h
    ./src/mesh/Mesh.h
    ./src/mesh/MeshLibrary.h
    ./src/mesh/MeshUtil.h
    ./src/mesh/OBJMeshLoader.h
    ./src/texture/Texture.h
    ./src/texture/TextureLibrary.h
    ./src/util/stringutil.h
    ./src/util/Timer.h
    ./src/VectorInterface.h
    ./src/world/AxisPrototype.h
    ./src/world/Camera.h
    ./src/world/Character.h
    ./src/world/Drawable.h
    ./src/world/Object.h
    ./src/world/ObjectMotionState.h
    ./src/world/Prototype.h
    ./src/world/RigidBody.h
    ./src/world/World.h
)



add_library(dwarf3d STATIC ${DWARF3D_SRC} ${DWARF3D_HEADERS})

target_link_libraries(dwarf3d stlport)
target_link_libraries(dwarf3d opengl32})
target_link_libraries(dwarf3d glu32})
target_link_libraries(dwarf3d SDL)
target_link_libraries(dwarf3d SDLmain)
target_link_libraries(dwarf3d BulletCollision)
target_link_libraries(dwarf3d BulletDynamics)
target_link_libraries(dwarf3d LinearMath)